package com.h3c.tj_nsh.UI.Adapter;

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 * Time: 2016/5/12.
 * Author:Chen  .
 * 修改RecyclerView的每个item样式与属性
 */
public class MyItemDecoration extends RecyclerView.ItemDecoration{
    private int space;
    public MyItemDecoration(int space){
        this.space=space;
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        if(parent.getChildLayoutPosition(view)!=0){
            outRect.top=space;
        }
    }
}
